package com.fenghongzhang.module_home

import com.fenghongzhang.lib_base.core.BaseRepository
import javax.inject.Inject

class HomeRepository @Inject constructor()  : BaseRepository()  {

    @Inject
    lateinit var homeApiService: HomeApiService

    suspend fun getTabLayoutData(): Result<HomeUIState> {
        val simpleType = homeApiService.getTabLayoutData()
        return if (simpleType.code == 200) {
            // 16, 返回数据
            Result.success(HomeUIState(simpleType = simpleType.data, isSucess = true))
        } else {
            Result.failure(IllegalArgumentException("没有数据"))
        }
    }
}